function Message(props) {
	const { status, message, required, name, value } = props
	let showMessage = ''
	let color = '#fff'
	if (required && !value && status === 'reject') {
		showMessage = `${name} 为必填项`
		color = 'red'
	} else if (status === 'reject') {
		showMessage = message
		color = 'red'
	} else if (status === 'pedding') {
		showMessage = null
	} else if (status === 'resolve') {
		showMessage = '校验通过'
		color = 'green'
	}

	return (
		<div>
			<span style={{ color, fontSize: '10px' }}>{showMessage}</span>
		</div>
	)
}
export default Message
